package com.object.utils;

import lombok.AllArgsConstructor;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;


@AllArgsConstructor
public enum NettyChantTypeEnum
{

    send(1, "发生信息", "LNettyMsgSendServiceImpl"), reception(2, "接收信息", "111");

    public Integer type;
    public String msg;
    public String beanName;


    public static NettyChantTypeEnum typeGetMsg(Integer type)
    {
        NettyChantTypeEnum[] values = NettyChantTypeEnum.values();
        List<NettyChantTypeEnum> collect = Arrays.stream(values).filter(i -> i.type == type).collect(Collectors.toList());
        System.out.println(collect.get(0).beanName);
        return collect.get(0);
    }
}
